home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor1 / skunk.doc < prev    next >
Text File  |  1995-03-31  |  10KB  |  204 lines

  1. (Comp.sys.handhelds) 
  2. Item: 3823 by dougc at bert.cs.byu.edu 
  3. Author: [DOUG CANNON] 
  4.   Subj: SKUNK! a great animated dice game for the HP48s! 
  5.   Date: Sat Aug 10 1991 
  6.  
  7. Description:    SKUNK is a 2 dice game of part strategy, part luck. 
  8.                 This game was written entirely in RPL code 
  9.                 and is loaded with great graphics and animation. 
  10.                 SKUNK may be played with one player and HP as 
  11.                 the opponent, or with two human players. 
  12.  
  13. About me:       SKUNK was written by Douglas R. Cannon.  I am currently 
  14.                 an electrical engineering student at Brigham Young 
  15.                 University in Provo, Utah.  As I am now on summer 
  16.                 vacation, I have had time for such frivolity. Fall 
  17.                 semester begins on Sept 4th and my HP48 fun will 
  18.                 abruptly end. 
  19.  
  20.                 Douglas R. Cannon 
  21.                 178 Wymount #4A 
  22.                 Provo, UT 84604 
  23.                 (801) 371-2632 
  24.                 dougc@bert.cs.byu.edu 
  25.  
  26. ---------------- 
  27.    A long time ago I learned the game of Skunk.  I am unaware of the author 
  28. of the original idea for the game, I think it (the game) is ancient.  I 
  29. first wrote this for the HP28s, but have not yet worked it to the point 
  30. of being posted.  Instead, I have been spending my time re-writing it for 
  31. the HP48s.  I finished the program today, August 7, 1991. 
  32.    The game is simple.  SKUNK will first give you an options menu: 
  33.  
  34. 1) HP as player #1 
  35. 2) HP as player #2 
  36. 3) Two players 
  37.  
  38. Only two players can play at one time, and HP will be one of those players 
  39. if you so desire.  Playing with two people gets boring fast, but the option 
  40. is available.  Choose an option by pressing 1, 2, or 3.  If you choose HP 
  41. to be one of the players, then you are given a Skill level menu: 
  42.  
  43. 1) Terribly easy 
  44. 2) Average 
  45. 3) Challenging 
  46.  
  47. The strategies are as follows: The easy strategy will always roll the dice 
  48. 5 times before passing. The average strategy will always roll the dice 3 
  49. times before passing. Surprisingly enough, this is a good strategy. (See 
  50. the RDME section below as to why I think so.) and, the Challenging strategy 
  51. would be less challenging if I told you what it is. If you can beat this 
  52. strategy 6 times out of 10 with a destination score of 200, then I 
  53. applaud you. 
  54.  
  55. After choosing a strategy, or if you choose two human players, then you are 
  56. given a destination score menu: 
  57.  
  58. 1) 100 points 
  59. 2) 200 points 
  60. 3) 300 points 
  61.  
  62. This is self-explanitory. Obviously, the winner is the one who gains or 
  63. passes this score. 
  64.  
  65.    At this point you begin play.  Player #1 rolls first, and his options are 
  66. to Roll or Pass. By pressing the A key, the dice are rolled, and by pressing 
  67. the F key you may pass.  Skunk is played with two dice.  The object is to 
  68. roll as many times as you can without getting "Skunked".  One is "Skunked" 
  69. when a one is rolled on either die.  If no ones are rolled, then the sum of 
  70. the two dice is added to the pot. If you are "Skunked" then you lose your 
  71. turn and the pot goes to zero.  If you choose to pass at some time, then the 
  72. current pot is added to your score.  The pot then returns to zero, and the 
  73. play passes to the next player. 
  74.    It is extremely disastrous to be "Double Skunked".  This is, of course, 
  75. when a one is rolled on each die.  At this point, the pot goes to zero, your 
  76. score goes to zero, and you lose your turn.  This is most undesireable. 
  77.    Now, it is only fair that everyone get the same amount of turns, so if 
  78. player #1 should reach or pass the destination score, then player #2 has one 
  79. more turn to pass the score of player #1.  Thus, if both players reach the 
  80. destination score, the winner is the player with the highest score.  You can 
  81. see the advantages to being player #2.  If player #2 reaches the destination 
  82. score, and player #1 has not yet reached it, player #2 wins immeadiately. 
  83. If both players reach the destination score and are tied, then it will go 
  84. into overtime until one player is >= the destination and > the other player's 
  85. score. 
  86.  
  87.    This is all you should need to know to play the game! I hope everyone 
  88. enjoys 
  89. this game!  I cannot compete with those who program the schip stuff, and have 
  90. not tried this method as of yet.  My main goal of writing this game was to 
  91. create some software that has nice animation, is fun, and is written 
  92. completely 
  93. in RPL code. 
  94.  
  95. --------------------- 
  96.  
  97. About the ABOUT: 
  98.    You can run the program ABOUT to find out about the author ( that's me ) 
  99. This software is distributed under the "I don't care ware" system and thus  
  100. you can give it to anybody, use any or all programs and shapes elsewhere, 
  101. and even change them if it pleases you.  Just leave the ABOUT program intact, 
  102. and I don't care. Otherwise I do care even though I will never know. 
  103.  
  104. RDME skunk1.0 
  105.  
  106.    Here is a list of all the programs and shapes for anyone who is interested. 
  107. Some of these programs (DNUM, NEWS, NANNY) may be useful in other 
  108. applications. 
  109. I have listed each program, its purpose, and the arguments it needs. 
  110.  
  111. Programs in order of appearance: 
  112. -------------------------------- 
  113.  
  114. SKUNK   Run This. It starts the game            ( no arguments ) 
  115. ABOUT   Run This. About the Author              ( no arguments ) 
  116. SKMAIN  The master control program              3: destination score 
  117.                                                 2: skill level (0 if 2 humans) 
  118.                                                 1: HP player # (3 if 2 humans) 
  119. NEWS    prints final score menu                 2: message (String) 
  120.                                                 1: coordinates 
  121. DNUM    Display a number                        2: number 
  122.                                                 1: coordinates 
  123. NANNY   The international song of the child     ( no arguments ) 
  124. Roll    Roll dice                               ( no arguments ) 
  125.                                         exit:   2: dice #1 
  126.                                                 1: dice #2 
  127. ERNUM   Erase a 25 by 8 spot ( a number )       1: 1, 2, or 3 
  128. TURN    Allows a human a turn                   2: score (size 2 array) 
  129.                                                 1: destination score 
  130. HPTURN  Allows HP a turn ( knows 3 strategies ) 4: score (size 2 
  131. array) 
  132.                                                 3: HP player # (1-2) 
  133.                                                 2: skill level (1-3) 
  134.                                                 1: destination score 
  135. QUIT    Do you REALLY want to quit?             ( no arguments ) 
  136. FANF    The "FANFARE" Somebody has won!         4: destination score 
  137.                                                 3: skill level (0-3) 
  138.                                                 2: HP player # (1-3) 
  139.                                                 1: score (size 2 array) 
  140. SK      Someone is SKUNKED!                     3: die #1 
  141.                                                 2: die #2 
  142.                                                 1: destination score 
  143. DSK     Someone is DOUBLE SKUNKED!!             1: destination score 
  144. MYTH    Well, this really is a myth you know    ( no arguments ) 
  145.  
  146.  
  147. Shapes in order of apearance: 
  148. ----------------------------- 
  149.  
  150. BOARD   GROB 131 64             The playing Board 
  151. SKSKP   GROB 71 31              The big SKUNK shape 
  152. DICE    A list of 6 GROBs       The dots on the dice 
  153. WAVES   A list of 10 GROBs      The wave in the options menu 
  154. DOTS    A list of 4 GROBs       The moving dots in the skill menu 
  155. BALLS   A list of 10 GROBs      The bouncing balls in the destination 
  156. menu 
  157. DESTIN  A list of 3 GROBs       Shows 100, 200, or 300 destination scores 
  158. YOUWON  A list of 13 GROBs      This creates the YOU WON! graphic 
  159. HPWON   A list of 13 GROBs      This crete e HP WON! graphic 
  160. PLANT   A list of 3 GROBs       The plant 
  161. POT     A list of 3 GROBs       The pot 
  162. SHAPES  A list of 7 GROBs       Various shapes 
  163.  
  164. -------------------------------------------------------------------------- 
  165.  
  166.    Following is some interesting data I collected while trying to find 
  167. three suitable strategies for HP to use.  I originally wrote a SKUNK  
  168. simulation on the HP to test various strategies and find the best one. 
  169. It was much to slow, ( It would take almost an hour to simulate 100 games 
  170. without the use of graphics ) so I wrote a version in Pascal. On a 386 it 
  171. could simulate 20,000 games in under 15 minutes. 
  172.    Now, I am not a stats man, but I used this simulator as follows: I would 
  173. program a specific strategy, and play it against another. They would play 
  174. for 3000 or 5000 games, and whichever strategy won the highest percentage 
  175. of games was obviously better. If I played the two against each other again, 
  176. they would consistently produce the same percentages. ( As long as the 
  177. number of simulated games was high enough.  3000 seemed adequate. ) 
  178.  
  179.         Strategy #1: Roll once 
  180.         Strategy #2: Roll twice 
  181.         Strategy #3: Roll three times   ( Used as average skill level ) 
  182.         Strategy #4: Roll four times 
  183.         Strategy #5: Roll five times    ( Uses as terribly easy skill level ) 
  184.  
  185.         #1: won 35.4% vs. #2: won 64.6% ( 3000 games ) 
  186.         #2: won 52.8% vs. #3: won 47.2% ( 3000 games ) 
  187.         #2: won 51.8% vs. #3: won 48.2% ( 20000 game re-match ) 
  188.         #2: won 60.3% vs. #4: won 39.7% ( 3000 games ) 
  189.         #2: won 68.5% vs. #5: won 31.5% ( 3000 games ) 
  190.  
  191.         #3: won 66.3% vs. #5: won 33.6% ( 10000 games ) 
  192.  
  193.    From this we can see that rolling twice always is the best strategy of 
  194. the five listed. Rolling 3 times always is not too bad, and I chose this 
  195. as the average strategy. It is above average when compared to these, but 
  196. only average when compared to better strategies. 
  197.  
  198.         Strategy #19: The Challenging strategy. 
  199.  
  200.         #5: won 22.1% vs. #19: won 77.9% 
  201.         #3: won 37.1% vs. #19: won 62.9% 
  202.  
  203. Not too bad, really. 
  204.